'''
Created on 2013-3-10
@author: F.L.F
@contact: http://digdata.me
'''
# coding=UTF-8
import urllib2
import re

def __fetch__(url,pattern):
    res=urllib2.urlopen(url)
    content = res.read()
    print content
    for m in re.finditer(pattern, content,re.MULTILINE):
        print u"IP:%s,Area:%s" % (m.group(1),m.group(2))
    
    
def fetchProxy():
    __fetch__("http://www.site-digger.com/html/articles/20110516/proxieslist.html",r"<td>(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\:\d{1,5})</td>\s+?<td>.+?</td>\s+?<td>(.+?)</th>")

if __name__=="__main__":
    fetchProxy()
    